
function vsOpenPrintPreview(view, form) {
	if(view=='work_summery') {
		var cbGroups = document.getElementById('filter_groups');
		var from = document.getElementById('fromVsdeDate');
		var to = document.getElementById('toVsdeDate');

		form.target="VsPrint";
		form.action = "print.php?view="+view+"&group="+cbGroups.options[cbGroups.selectedIndex].value+"&group_by=operation&fromVsdeDate="+from.value+"&toVsdeDate="+to.value;
		//alert(form.action);
		window.open('about:blank', 'VsPrint', 'width=800,height=500,toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,direction=no');
	
		form.submit();
	}
	else if(view=='operator_work') {
		var opId = document.getElementById('operator_id').innerHTML;
		var from = document.getElementById('fromVsdeDate');
		var to = document.getElementById('toVsdeDate');

		var addr = "print.php?view="+view+"&op_id="+opId+"&fromVsdeDate="+from.value+"&toVsdeDate="+to.value;
		//alert(form.action);
		window.open(addr, 'VsPrint', 'width=800,height=500,toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,direction=no');
	}
	else if(view=='operator_work_grouped') {
		var opId = document.getElementById('operator_id').innerHTML;
		var from = document.getElementById('fromVsdeDate');
		var to = document.getElementById('toVsdeDate');

		var addr = "print.php?view="+view+"&op_id="+opId+"&group_by=operation&fromVsdeDate="+from.value+"&toVsdeDate="+to.value;
		//alert(form.action);
		window.open(addr, 'VsPrint', 'width=800,height=500,toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,direction=no');
	}
	else if(view=='work_count') {
		var modelId = document.getElementById('modid').value;
		var from = document.getElementById('fromVsdeDate');
		var to = document.getElementById('toVsdeDate');

		var addr = "print.php?view="+view+"&modid="+modelId+"&fromVsdeDate="+from.value+"&toVsdeDate="+to.value;
		//alert(form.action);
		window.open(addr, 'VsPrint', 'width=800,height=500,toolbar=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,direction=no');
	}
}
//======================================================================================================

